

export default {
    namespaced: true,
    state: {
        isShowToast: false,
        msg: "",
        type: ""
    },
    mutations: {
        changeIsShowToast(state, payload) {
            state.isShowToast = payload.isShow;
            state.msg = payload.msg;
            state.type = payload.type;
        }
    },
    actions: {
        asyncchangeIsShowToast(state,payload) {
            state.commit('changeIsShowToast',{
                isShow: true,
                msg: payload.msg,
                type: payload.type
            })
            setTimeout(() => {
                state.commit('changeIsShowToast',{
                    isShow: false,
                    msg: payload.msg,
                    type: payload.type
                });
            }, 1500)
        }
    },
}